export const tableColumns = [
  {
    key: 'source1',
    name: '来源',
    visible: true,
    width: 100,
  },
  {
    key: 'codeGroup',
    name: '编码组',
    visible: true,
    width: 100,
    sortable: true,
    customSort: (a, b) => {
      const char1 = a.codeGroup[0]
      const char2 = b.codeGroup[0]
      return char1.charCodeAt(0) - char2.charCodeAt(0)
    },
  },
  {
    key: 'codeGroupCn',
    name: '编码组中文',
    visible: true,
    width: 120,
    sortable: true,
    customSort: (a, b) => {
      return a.codeGroupCn.localeCompare(b.codeGroupCn)
    },
  },
  {
    key: 'codeName',
    name: '编码名',
    visible: true,
    width: 120,
    sortable: true,
    customSort: (a, b) => {
      const char1 = a.codeName[0]
      const char2 = b.codeName[0]
      return char1.charCodeAt(0) - char2.charCodeAt(0)
    },
  },
  {
    key: 'codeNameCn',
    name: '编码名中文',
    visible: true,
    width: 120,
    sortable: true,
    customSort: (a, b) => {
      return a.codeNameCn.localeCompare(b.codeNameCn)
    },
  },
  {
    key: 'codeValue',
    name: '编码值',
    visible: true,
    width: 90,
    sortable: true,
    customSort: (a, b) => {
      return a.codeValue - b.codeValue
    },
  },
  {
    key: 'codeDescribe',
    name: '编码描述',
    visible: true,
    width: 100,
    sortable: true,
    customSort: (a, b) => {
      return a.codeDescribe.localeCompare(b.codeDescribe)
    },
  },
  {
    key: 'sort',
    name: '排序',
    visible: true,
    width: 200,
    sortable: true,
    customSort: (a, b) => {
      return a.sort - b.sort
    },
  },
  {
    key: 'fatherCodeName',
    name: '父级编码名称',
    visible: true,
    width: 140,
  },
  {
    key: 'fatherCodeValue',
    name: '父级编码值',
    visible: true,
    width: 120,
  },
  {
    key: 'effectuate',
    name: '生效状态',
    visible: true,
    width: 100,
    sortable: true,
    customSort: (a, b) => {
      return a.effectuate.localeCompare(b.effectuate)
    },
  },
  {
    key: 'createBy',
    name: '创建人',
    visible: true,
    width: 90,
    sortable: true,
    customSort: (a, b) => {
      return a.createBy.localeCompare(b.createBy)
    },
  },
  {
    key: 'createTime',
    name: '创建时间',
    visible: true,
    width: 180,
  },
]
